from ultralytics import YOLO

model = YOLO('runs/segment/train/weights/best.pt')


# Evaluate model performance on the validation set
metrics = model.predict(task='segment')

# Perform object detection on an image
results = model("datasets/Drawing Annotation Recognition2.v1i.yolov12/test/images"
"/Untitled_png.rf.d59ec9e6949e043c86f6c3ad8e33bcd6.jpg",task='segment')
for result in results:
    masks = result.masks  # 获取分割掩码
    if masks is not None:
        print("Segmentation Masks:", masks)
